import request from '@/utils/request'

/**
 * 获取文章列表
 */
export const getArticleListApi = data => {
  return request({
    method: 'get',
    url: '/ydd_article/list',
    params: data
  })
}

/**
 * 删除文章
 */

export const delArticleApi = id => {
  return request({
    method: 'get',
    url: `/ydd_article/del?id=${id}`
  })
}

/**
 * 新增文章
 */
export const addArticleApi = data => {
  return request({
    method: 'post',
    url: '/ydd_article/add',
    data
  })
}

/**
 *  文章详情
 */
export const getArticleDetaileApi = id => {
  return request({
    method: 'get',
    url: `/ydd_article/rowInfo?id=${id}`
  })
}

/**
 * 修改
 */
export const editArticleDetaileApi = data => {
  return request({
    method: 'post',
    url: '/ydd_article/update',
    data
  })
}
